package com.rwlai.dianshang.repository;

import com.rwlai.dianshang.domain.Order;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by liutim on 2017/11/28.
 */
@Repository
public interface OrderRepository  extends JpaRepository<Order,String>{


    @Query("select oi.parent from OrderItem oi where oi.product.name=?1")
List<Order> findByItemsProduct_Name(String name);

}
